import base64
import glob

import requests

for img_path in sorted(glob.glob("./images/*.png")):
    print(img_path)
    with open(img_path, "rb") as f:
        img = f.read()
        b64 = base64.b64encode(img).decode("utf8")
        res = requests.post("http://localhost:5000/idcard-ocr", json={"image": b64})
        print(res.json())
